package cate.game.play.bg;

import cate.game.role.Role;
import cate.game.role.bag.hero.Hero;
import cate.game.role.res.guild.po.GuildPO;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "基于每个英雄的背景介绍",detail = "各类提供属性的功能信息")
public class HeroBg {

    @NoteField("英雄的唯一ID")
    public String heroUid;

    @NoteField("世界树等级")
    public int worldTreeLevel;

    @NoteField("协会等级")
    public int guildLevel;

    public HeroBg copy() {
        HeroBg cp = new HeroBg();
        cp.heroUid = heroUid;
        cp.worldTreeLevel = worldTreeLevel;
        cp.guildLevel = guildLevel;
        return cp;
    }

    public HeroBg() {
    }

    public HeroBg(Role role, Hero hero) {
        this.heroUid = hero.uid;
        if (role != null) {
            GuildPO guild = role.getRes().guild.getGuild();
            if (guild != null) {
                guildLevel = guild.basic.level;
            }
        }
    }
}
